<?php
namespace app\demo\middleware;

//定义中间件
class Detail{
	public function handle($request,\Closure $next){
		dump('html');
		$request->type = 'detail';
		return $next($request);
	}

	/**
	 * 中间件结束调度
	 */
	public function end(\think\Response $response){
		//记录一些日志等
	}
}